package cn.jiyun.controller;

import cn.jiyun.common.config.Result;
import cn.jiyun.pojo.Log;
import cn.jiyun.pojo.User;
import cn.jiyun.service.LogService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("log")
@CrossOrigin
public class LogController {
    @Autowired
    private LogService logService;

    @RequestMapping("/findPage")
    public Result findPage(Integer pageNum, Integer pageSize, @RequestBody Log log){
        Page page=logService.findPage(pageNum,pageSize,log);
        return  Result.ok(page);
    }

    @RequestMapping("/findById")
    public Result findById(Integer id){
        Log log=logService.getById(id);
        return Result.ok(log);
    }
}
